package com.example.money.test.HideToobar;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.support.v7.widget.Toolbar;

import com.example.money.test.R;
import com.example.money.test.TabLayout.ListRecyclerAdapter;

public class BehaviorOneActivity extends AppCompatActivity {
    private CollapsingToolbarLayout mCollapsing;
    private Toolbar mToolbar;
    private RecyclerView mRecycler;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.behavior_one_layout);
        init();
        setSupportActionBar(mToolbar);
        mCollapsing.setTitle("绿谷出久!");
        mRecycler.setLayoutManager(new StaggeredGridLayoutManager(1,StaggeredGridLayoutManager.VERTICAL));
        mRecycler.setItemAnimator(new DefaultItemAnimator());
        mRecycler.setAdapter(new ListRecyclerAdapter(BehaviorOneActivity.this));
    }

    private void init() {
        mCollapsing = findViewById(R.id.collapsing_layout);
        mToolbar = findViewById(R.id.toolbar);
        mRecycler = findViewById(R.id.recycler);
    }
}
